<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Form</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <link href="/sap/demo.css" rel="stylesheet" type="text/css" />
    <script src="/sap/scripts/boot.js" type="text/javascript"></script>
</head>
<style>

    td{
        margin-top:10px;

    }
</style>
<body>

<div id="grid1" class="mini-datagrid" style="width:100%;height:550px;"
     url="/SapSupplier/permissioncaigoudata/timeTagStart/<?php echo $timeTagStart;?>/timeTagComplete/<?php echo $timeTagComplete;?>" idField="id"
     allowResize="true" showFilterRow="true" pageSize="50"
     allowCellEdit="true" allowCellSelect="true" multiSelect="true"
     editNextOnEnterKey="true">
    <if condition="($userInfo['dept'] eq 'c4ca4238a0b923820dcc509a6f75849b') ">
        <div property="columns">

            <!--<div header="平台代码" field="CardCode" width="80px">-->
                <!--<input id="CardCodeFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->
            <!--<div header="平台名称" field="CardName"  width="80px">-->
                <!--<input id="CardNameFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->

            <div header="供应商代码" field="SupplierCode" width="80px">
            <input id="CardCodeFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="供应商名称" field="SupplierName"  width="80px">
            <input id="CardNameFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="供应商电话" field="phone1"  width="200px">
                <input id="phone1Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="供应商地址" field="address"  width="50px">
                <input id="addressFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="业务主管" field="name1"  width="200px">
                <input id="name1Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

            <div header="主管联系电话" field="tel1" width="80px">
                <input id="tel1Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="主管邮箱" field="E_mail1"  width="80px">
                <input id="E_mail1Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="业务员" field="name2"  width="200px">
                <input id="name2Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="业务员电话" field="tel2"  width="50px">
                <input id="tel2Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="业务员邮箱" field="E_mail2"  width="200px">
                <input id="E_mail2Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

            <div header="引入产品经理" field="introducer" width="80px">
                <input id="introducerFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="合同起始时间" field="contactstart"  width="80px">
                <input id="contactstartFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="合同到期时间" field="contactend"  width="200px">
                <input id="contactendFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="银行卡号" field="dflaccount"  width="50px">
                <input id="dflaccountFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="银行卡开户名称" field="bankcode"  width="200px">
                <input id="bankcodeFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

            <div header="采购订单号" field="Docnum" width="80px">
                <input id="DocnumFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="单据时间" field="docdate"  width="80px">
                <input id="docdateFilter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="到货时间" field="docdudate"  width="200px">
                <input id="docdudateFilter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="物料编号" field="Itemcode"  width="50px">
                <input id="ItemcodeFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="物料名称" field="Dscription"  width="200px">
                <input id="DescriptionFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

            <div header="型号" field="U_SO002" width="80px">
                <input id="U_SO002Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="颜色" field="U_CG003"  width="80px">
                <input id="U_CG003Filter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="是否3C" field="u_is3c"  width="200px">
                <input id="u_is3cFilter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="产品经理" field="u_pmanager"  width="50px">
                <input id="u_pmanagerFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

            <div header="采购员" field="slpname"  width="50px">
                <input id="slpnameFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="数量" field="Quantity"  width="50px">
                <input id="QuantityFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="上次采购价格" field="U_CG002"  width="50px">
                <input id="U_CG002Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="采购单价" field="PriceBefDi"  width="50px">
                <input id="PriceBefDiFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="采购小计" field="LineTotal"  width="50px">
                <input id="LineTotalFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

            <div header="采购总计" field="DocTotal"  width="50px">
                <input id="DocTotalFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

        </div>
        <else />
        <if condition="($userInfo['dept'] eq 'c81e728d9d4c2f636f067f89cc14862c') ">
            <div property="columns">

            <div header="平台代码" field="CardCode" width="80px">
                <input id="CardCodeFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="平台名称" field="CardName"  width="80px">
                <input id="CardNameFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

            <!--<div header="供应商代码" field="SupplierCode" width="80px">-->
                <!--<input id="CardCodeFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->
            <!--<div header="供应商名称" field="SupplierName"  width="80px">-->
                <!--<input id="CardNameFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->
            <!--<div header="供应商电话" field="phone1"  width="200px">-->
                <!--<input id="phone1Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->
            <!--<div header="供应商地址" field="address"  width="50px">-->
                <!--<input id="addressFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->
            <!--<div header="业务主管" field="name1"  width="200px">-->
                <!--<input id="name1Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->

            <!--<div header="主管联系电话" field="tel1" width="80px">-->
                <!--<input id="tel1Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->
            <!--<div header="主管邮箱" field="E_mail1"  width="80px">-->
                <!--<input id="E_mail1Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->
            <!--<div header="业务员" field="name2"  width="200px">-->
                <!--<input id="name2Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->
            <!--<div header="业务员电话" field="tel2"  width="50px">-->
                <!--<input id="tel2Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->
            <!--<div header="业务员邮箱" field="E_mail2"  width="200px">-->
                <!--<input id="E_mail2Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->

            <div header="引入产品经理" field="introducer" width="80px">
                <input id="introducerFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="合同起始时间" field="contactstart"  width="80px">
                <input id="contactstartFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="合同到期时间" field="contactend"  width="200px">
                <input id="contactendFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="银行卡号" field="dflaccount"  width="50px">
                <input id="dflaccountFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="银行卡开户名称" field="bankcode"  width="200px">
                <input id="bankcodeFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

            <div header="采购订单号" field="Docnum" width="80px">
                <input id="DocnumFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="单据时间" field="docdate"  width="80px">
                <input id="docdateFilter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="到货时间" field="docdudate"  width="200px">
                <input id="docdudateFilter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="物料编号" field="Itemcode"  width="50px">
                <input id="ItemcodeFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="物料名称" field="Dscription"  width="200px">
                <input id="DescriptionFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

            <div header="型号" field="U_SO002" width="80px">
                <input id="U_SO002Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="颜色" field="U_CG003"  width="80px">
                <input id="U_CG003Filter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="是否3C" field="u_is3c"  width="200px">
                <input id="u_is3cFilter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="产品经理" field="u_pmanager"  width="50px">
                <input id="u_pmanagerFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>

            <div header="采购员" field="slpname"  width="50px">
                <input id="slpnameFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <div header="数量" field="Quantity"  width="50px">
                <input id="QuantityFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
            </div>
            <!--<div header="上次采购价格" field="U_CG002"  width="50px">-->
                <!--<input id="U_CG002Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->
            <!--<div header="采购单价" field="PriceBefDi"  width="50px">-->
                <!--<input id="PriceBefDiFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->
            <!--<div header="采购小计" field="LineTotal"  width="50px">-->
                <!--<input id="LineTotalFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->

            <!--<div header="采购总计" field="DocTotal"  width="50px">-->
                <!--<input id="DocTotalFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>-->
            <!--</div>-->

        </div>
            <else />
            <div property="columns">

                <div header="平台代码" field="CardCode" width="80px">
                    <input id="CardCodeFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="平台名称" field="CardName"  width="80px">
                    <input id="CardNameFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="供应商代码" field="SupplierCode" width="80px">
                    <input id="CardCodeFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="供应商名称" field="SupplierName"  width="80px">
                    <input id="CardNameFilter" property="filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="供应商电话" field="phone1"  width="200px">
                    <input id="phone1Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="供应商地址" field="address"  width="50px">
                    <input id="addressFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="业务主管" field="name1"  width="200px">
                    <input id="name1Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>

                <div header="主管联系电话" field="tel1" width="80px">
                    <input id="tel1Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="主管邮箱" field="E_mail1"  width="80px">
                    <input id="E_mail1Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="业务员" field="name2"  width="200px">
                    <input id="name2Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="业务员电话" field="tel2"  width="50px">
                    <input id="tel2Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="业务员邮箱" field="E_mail2"  width="200px">
                    <input id="E_mail2Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>

                <div header="引入产品经理" field="introducer" width="80px">
                    <input id="introducerFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="合同起始时间" field="contactstart"  width="80px">
                    <input id="contactstartFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="合同到期时间" field="contactend"  width="200px">
                    <input id="contactendFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="银行卡号" field="dflaccount"  width="50px">
                    <input id="dflaccountFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="银行卡开户名称" field="bankcode"  width="200px">
                    <input id="bankcodeFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>

                <div header="采购订单号" field="Docnum" width="80px">
                    <input id="DocnumFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="单据时间" field="docdate"  width="80px">
                    <input id="docdateFilter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="到货时间" field="docdudate"  width="200px">
                    <input id="docdudateFilter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="物料编号" field="Itemcode"  width="50px">
                    <input id="ItemcodeFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="物料名称" field="Dscription"  width="200px">
                    <input id="DescriptionFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>

                <div header="型号" field="U_SO002" width="80px">
                    <input id="U_SO002Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="颜色" field="U_CG003"  width="80px">
                    <input id="U_CG003Filter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="是否3C" field="u_is3c"  width="200px">
                    <input id="u_is3cFilter" class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="产品经理" field="u_pmanager"  width="50px">
                    <input id="u_pmanagerFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>

                <div header="采购员" field="slpname"  width="50px">
                    <input id="slpnameFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="数量" field="Quantity"  width="50px">
                    <input id="QuantityFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="上次采购价格" field="U_CG002"  width="50px">
                    <input id="U_CG002Filter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="采购单价" field="PriceBefDi"  width="50px">
                    <input id="PriceBefDiFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>
                <div header="采购小计" field="LineTotal"  width="50px">
                    <input id="LineTotalFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>

                <div header="采购总计" field="DocTotal"  width="50px">
                    <input id="DocTotalFilter"  class="mini-textbox" style="width:100%;" onvaluechanged="onFilterChanged"/>
                </div>

            </div>
        </if>
    </if>
</div>

<script type="text/javascript">
    mini.parse();
    var grid1 = mini.get("grid1");
    grid1.load();

    //绘制表格
    grid1.on("drawcell", function (e) {

        var record = e.record,
            column = e.column,
            field = e.field,
            value = e.value;

        //格式化日期
        if (field == "contactstart" || field == "contactend" || field == "docdate" || field == "docdudate" ) {
            if (mini.isDate(value)) e.cellHtml = mini.formatDate(value, "yyyy-MM-dd HH:mm:ss");
        }

    });

</script>

<script type="text/javascript">

    function onFilterChanged(e) {

        var CardCodeBox = mini.get("CardCodeFilter");
        var CardNameBox = mini.get("CardNameFilter");

        var CardCode = CardCodeBox.getValue().toLowerCase();
        var CardName = CardNameBox.getValue().toLowerCase();

        //多条件组合过滤
        grid1.filter(function (row) {

            var r_CardCode = true;
            if (CardCode) {
                r_CardCode = String(row.CardCode).toLowerCase().indexOf(CardCode) != -1;
            }

            var r_CardName = true;
            if (CardName) {
                r_CardName = String(row.CardName).toLowerCase().indexOf(CardName) != -1;
            }

            return r_CardCode && r_CardName;
        });
    }

</script>

</body>
</html>